<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="css/pagination.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />

<link href="css/style.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>订单管理</title>
</head>
<body>

	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页
		 <span class="c-gray en">&gt;</span>订单预警
		
		<a class="btn btn-success btn-refresh radius r mr-20 mt-5" onclick="javascript:location.replace(location.href);" 
			href="javascript:location.replace(location.href);" title="刷新">刷新</a>
	</nav>
	<div class="pd-20">
		<!--search-->
		<div class="cl pd-5 bg-1 bk-gray"> 
		<form action="<%=path%>/backstage/order-list" method="get" class="form form-horizontal" id="search-form">
	
	   			<div class="cl">
		   			<label class="form-label col-1">站点：</label>

					<div class="formControls col-2">
					<span class="select-box">
						<select name="cityId" class="select" >
							<option value="-1">----</option>
							<c:forEach items="${citys}" var="city">
							<option value="${city.id}" <c:if test="${city.id==conditions.cityId}">selected</c:if> >${city.name}</option>
							</c:forEach>
						</select>
					</span>
					</div>

					<div class="formControls col-6">
						<button name="" id="" class="btn btn-success f-r radius mr-20" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<button name="" onclick="theReset();" id="" class="btn btn-success mr-5" >重置</button>

					</div>
				</div>
		</form>
		</div>
		<!--/search-->

		<div class="mt-10 cl pd-5 bg-1 bk-gray">
			
			<div class="float_div">未处理时间：</div>
			<a id="one" name="-1"  class="float_div red">30分钟</a>
			<a id="three" name="1" class="float_div yellow">15分钟</a>
			<a id="four" name="2" class="float_div blue">5分钟</a>
			<a id="fives" name="3" class="float_div gray">0-5分钟</a>
			<div id="result_timer" style="color:red; margin:5px; margin-left:15px; float:left;"></div>
		</div>

	


		<div class="mt-20">
			<table style="min-width:1000px;"
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th>操作</th>
						<th>商铺名称</th>
						<th>订单号</th>
						<th>订单状态</th>
						<th>金额</th>
						<th>商家电话</th>
						<th>收货人</th>
						<th>收货电话</th>
						<th>下单时间</th>
					</tr>
				</thead>
				<tbody>
						<c:forEach items="${orders}" var="order">
						<tr class='text-c <c:choose>
									<c:when test="${order.alarm_level == 1}">
										red
									</c:when>
									<c:when test="${order.alarm_level == 2}">
										yellow
									</c:when>
									<c:when test="${order.alarm_level == 3}">
										blue
									</c:when>
									<c:otherwise>
									 gray
									</c:otherwise>
								</c:choose>
								'>
							<input type="hidden" id="orderid" name="orderid" value='${order.titles}' />

							<td class="td-manage">
								<a class="label label-primary radius" style="text-decoration:none" data-title="订单详情-${order.titles}" 
								 onclick="Hui_admin_tab(this)" _href="<%=path%>/backstage/order-details?rid=${order.rid}" href="javascript:;" >详情</a>	
							</td>
							<td>${order.c_sname }</td>
							<td>${order.titles }</td>
							<td>
								<c:choose>
									<c:when test="${(order.enable == 1 && order.dd_status == 1 && order.zi_status ==1) or (order.enable == 1 && order.dd_status == 1 && order.zi_status ==0 && order.zf_type == 3) }">
										待处理
									</c:when>
									<c:when test="${order.enable == 5}">
										已完成
									</c:when>
									<c:when test="${order.spstatus < 4}">
										正在处理
									</c:when>
									<c:when test="${order.spstatus > 3}">
										配送中
									</c:when>
									<c:when test="${order.zi_status == 0 && order.zf_type != '3'}">
										未支付
									</c:when>
									<c:otherwise>
										未知
									</c:otherwise>
								</c:choose>
							
							</td>
	
							<td>${order.paymoney }</td>
							<td>${order.c_mobi }</td>
							<td>${order.name }</td>
							<td>${order.mobile }</td>

							<td>${order.appdate }</td>
		
						</tr>
					</c:forEach>
				</tbody>
			</table>
		<div id="Pagination" class="page-con"></div>
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/jquery.pagination.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript" src="js/timer.js"></script>

	<script type="text/javascript">
	
	function showTime()
	{
		var today=new Date()
		var h=today.getHours()
		var m=today.getMinutes()
		var s=today.getSeconds()

		$("#result_timer").html("刷新时间："+h+":"+m+":"+s);
	}
	showTime();

	var _sec = 0;
	$.timer(function(){	
		location.href = '<%=path%>/backstage/order_alarm-list?time=' + new Date();
	},60000, true);


	$(function() {
		initPager();
	});
	
	var showCount = ${pageInfo.showCount};
	var currentPage = ${pageInfo.currentPage-1};
	var totalResult = ${pageInfo.totalResult};
	function initPager(){
		$("#Pagination").pagination(totalResult, {
            callback: function(new_page_index, pagination_container){
            	var oldLocation = location.href;
            	var pa = "currentPage=" + (new_page_index+1);
        		var shoC = "showCount=" + showCount;
            	var index = oldLocation.lastIndexOf("?");
            	if (index == -1){
            		location.href = oldLocation + "?" + pa + "&" + shoC;
            	}else if (oldLocation.indexOf("currentPage") == -1){
            		location.href = oldLocation + "&" + pa;
            	}else if (oldLocation.indexOf("showCount") == -1){
            		location.href = oldLocation + "&" + shoC;
            	}else{
            		var temp = oldLocation.replace(/currentPage=\d+/, pa);
					var newLocation = temp.replace(/showCount=\d+/, shoC);
            		location.href = newLocation;
            	}
            	return false;
            },
            items_per_page:showCount, 
            load_first_page:false,
            prev_text:'上一页',
            next_text:'下一页',
            ellipse_text:'...',
            num_edge_entries:1,
            num_display_entries:5,
            current_page:currentPage,
        });
	}
	
	/*
	重置
	*/
	function theReset(){
		$("#search-form input[type='text']").val('');
		$("#search-form select").val(-1);
	}	

		
	/*查看*/
	function show(title,url){
		var index = layer.open({
			type: 2,
			title: title,
			content: url
		});
		layer.full(index);
	}


</script>
</body>
</html>